package org.iblink.core.service;

import java.util.List;

import org.iblink.core.domain.model.Category;

/**
 * Interface to manager categories.
 * 
 * @author tpares
 *
 */
public interface CategoryService {
  /**
   * <p>Saves a category.</p>
   * @param category the category to save
   */
  void save(Category category);
  
  /**
   * <p>Deletes a category.</p>
   * @param category the category to delete
   */
  void delete(Category category);
  
  /**
   * <p>Returns the sub-categories of a category.</p>
   * @param category the category for which the subcategories are returned
   * @return the list a sub-categories for <code>category</code>
   */
  List<Category> getSubCategories(Category category);
  
  /**
   * <p>Returns all categories.</p>
   * @return the list of all persistent categories
   */
  List<Category> findAll();
  
  /**
   * <p>Returns root categories</p>
   * @return the root categories
   */
  List<Category> getRoots();
}
